package com.example.demo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * (Course)实体类
 *
 * @author hjl
 * @since 2020-11-30 21:31:12
 */
public class Course implements Serializable {

    private static final long serialVersionUID = 152453104837859202L;

    private Integer id;
    /**
     * 老师的id
     */
    private Integer userId;
    /**
     * 课程名字
     */
    private String courseTitle;
    /**
     * 课程简介
     */
    private String courseIntroduction;
    /**
     * 课程图片
     */
    private String courseImage;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Course course = (Course) o;
        return Objects.equals(id, course.id) &&
                Objects.equals(userId, course.userId) &&
                Objects.equals(courseTitle, course.courseTitle) &&
                Objects.equals(courseIntroduction, course.courseIntroduction) &&
                Objects.equals(courseImage, course.courseImage) &&
                Objects.equals(createtime, course.createtime) &&
                Objects.equals(updatetime, course.updatetime) &&
                Objects.equals(obj1, course.obj1) &&
                Objects.equals(obj2, course.obj2);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, courseTitle, courseIntroduction, courseImage, createtime, updatetime, obj1, obj2);
    }

    /**
     * 创建时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createtime;
    /**
     * 更新时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatetime;

    private String obj1;

    private String obj2;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getCourseTitle() {
        return courseTitle;
    }

    public void setCourseTitle(String courseTitle) {
        this.courseTitle = courseTitle;
    }

    public String getCourseIntroduction() {
        return courseIntroduction;
    }

    public void setCourseIntroduction(String courseIntroduction) {
        this.courseIntroduction = courseIntroduction;
    }

    public String getCourseImage() {
        return courseImage;
    }

    public void setCourseImage(String courseImage) {
        this.courseImage = courseImage;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Date getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }

    public String getObj1() {
        return obj1;
    }

    public void setObj1(String obj1) {
        this.obj1 = obj1;
    }

    public String getObj2() {
        return obj2;
    }

    public void setObj2(String obj2) {
        this.obj2 = obj2;
    }

}